// 题目来源：https://iai.sh.cn/problem/759
#include <bits/stdc++.h>
using namespace std;

int a, b, c, cnt;

int main() {
  cin >> a >> b >> c;
  if (a > 0 && b > 0)
    cout << b / c - (a - 1) / c;
  else if (a < 0 && b < 0)
    cout << (-a) / c - (-b - 1) / c;
  else
    cout << (-a) / c + 1 + b / c;

  return 0;
}